home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / blrmu13.zip / BEEP7.ASM < prev    next >
Assembly Source File  |  1990-08-28  |  2KB  |  58 lines

  1. page ,132
  2. title beep7 ( send 7 beeps to console) as of 08/28/90 - 02:15 pm
  3. ;*---------------------------------
  4. was      macro  nos
  5.          local  loop
  6. ;*---------------------------------
  7. ;*   wait a sec
  8. ;*---------------------------------
  9. ;*   nos = number of seconds
  10. ;*---------------------------------
  11.          push  cx                     ; save cx
  12.          mov   ah,44                  ; get current time
  13.          int   33                     ; dos call
  14.          mov   bh,dh                  ; get seconds
  15.          add   bh,nos                 ; add requested seconds
  16.          cmp   bh,60                  ; check for max seconds
  17.          jl    loop                   ; if lo, loop
  18.          sub   bh,60                  ; adjust seconds
  19. loop:
  20.          mov   ah,44                  ; get current time
  21.          int   33                     ; dos call
  22.          cmp   bh,dh                  ; requested delay complete ?
  23.          jne   loop                   ; if not, carry on
  24.          pop   cx                     ; restore cx
  25.          endm
  26. ;*---------------------------------
  27. cseg     segment para public 'beep7'
  28. ;
  29.          assume cs:cseg,ds:cseg,ss:cseg,es:cseg
  30. ;
  31.          org   256                     ; where to start
  32. ;
  33. go:      jmp   beep                    ; jump around msg
  34. ;
  35. Beephdg  db    13,10,10
  36.          db    '***   Beeping 7 Times   ***'
  37.          db    13,10,10,'$'
  38. ;
  39. beep:
  40.          lea   dx,beephdg              ; display
  41.          mov   ah,9h                   ; the
  42.          int   21h                     ; heading
  43. ;
  44.          mov   cx,7                    ; set beep limit
  45. ;
  46. beeploop:
  47.          mov   dl, 7                   ; beep char
  48.          mov   ah,2                    ; char out
  49.          int   33                      ; send beep
  50.          was   1                       ; wait 1 second
  51.          loop  beeploop                ; do it 7 times
  52. ;
  53.          mov   ax,4C00H                ; terminate with 0 ret code
  54.          int   33                      ; exit
  55. ;
  56. cseg     ends
  57.          end   go
  58.